<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'agent-company-form',
		'htmlOptions'=>array('enctype'=>'multipart/form-data'),
	'enableAjaxValidation'=>false,
));
$user_id=yii::app()->request->getParam(user_id);
if($user_id!=""){
	$user=User::model()->find('user_id='.$user_id);
}
?>

	<p class="note"><?php echo Yii::t('base','Fields with <span class="required">*</span> are required.');?></p>

	<?php echo $form->errorSummary($model); ?>
	<?php echo $form->hiddenField($model,'agent_number'); ?>
	<input type="hidden" value="<?php echo $user_id;?>" id="AgentCompany_user_id" name="AgentCompany[user_id]">
	<div class="row">
		<?php echo $form->labelEx($model,'user_name');?>
		<input type="text" value="<?php echo $user->user_name;?>" id="AgentCompany_name" name="AgentCompany[name]">
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'phone'); ?>
		<?php echo $form->textField($model,'phone',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'phone'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'email'); ?>
		<?php echo $form->textField($model,'email',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'email'); ?>
	</div>
	<div class="row">
		<?php echo $form->labelEx($model,'agent_type'); ?>
		<?php echo $form->dropDownList($model,'agent_type',array('1'=>'一级代理商','2'=>'二级代理商','3'=>'三级代理商')); ?>
		<?php echo $form->error($model,'agent_type'); ?>
	</div>
	<div class="row">
		<?php echo $form->labelEx($model,'credit');?>
		<?php echo $form->textField($model,'credit');?>
		<?php echo $form->error($model,'credit');?>
	</div>
	<div class="row">
		<?php echo $form->labelEx($model,'filename'); ?>
		<?php echo CHtml::activeFileField($model,'filename'); ?>
		<?php echo $form->error($model,'filename'); ?>
	</div>
	<div class="row buttons">
<?php echo CHtml::submitButton($model->isNewRecord ? Yii::t('base','Create') : Yii::t('base','Save')); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->